Sensor Fusion for Kinetis MCUs (ISSDK/KSDK version)
drivers.h
Go to the documentation of this file.
1 // Copyright (c) 2014, 2015, 2016, NXP Semiconductors N.V.,
2 // All rights reserved.
3 //
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name of NXP Semiconductors N.V. nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 // DISCLAIMED. IN NO EVENT SHALL NXP SEMICONDUCTORS N.V. BE LIABLE FOR ANY
19 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 //
26 
27 
28 /*! \file drivers.h
29  \brief Provides function prototypes for driver level interfaces
30 
31  Users who are not using NXP hardware will need to supply their own drivers
32  in place of those defined here.
33 */
34 
35 #ifndef DRIVERS_H
36 #define DRIVERS_H
37 #include "Driver_I2C.h"
38 #include "Driver_SPI.h"
39 
40 // must #include "sensor_fusion.h" before this file
41 
42 /// @name SysTick Macros
43 /// The ARM SysTick counter is used to time various fusion options. Timings
44 /// are then conveyed to the NXP Sensor Fusion Toolbox, where they are displayed
45 /// for the developer. These functions should be portable to any ARM M0+, M3,
46 /// M4 or M4F device. If you are using a different CPU architecture, you will
47 /// need to provide an equivalent set of macros, remove the macro calls from
48 /// the fusion routines, or define a set of empty macros.
49 ///@{
50 void ARM_systick_enable(void);
51 void ARM_systick_start_ticks(int32_t *pstart);
52 int32_t ARM_systick_elapsed_ticks(int32_t start_ticks);
53 void ARM_systick_delay_ms(uint32_t iSystemCoreClock, uint32_t delay_ms);
54 ///@}
55 
56 /// @name Sensor Drivers
57 /// Each physical sensor must be provided with one initialization function
58 /// and one "read" function. These must be installed by the user using the
59 /// installSensor method defined in SensorFusionGlobals. By "physical sensor",
60 /// we mean either individual sensor type (such as a 3-axis accelerometer) or
61 /// a combo-sensor such as the NXP FXOS8700 6-axis accel plus mag. The init()
62 /// function for each sensor is responsible for initializing all sensors contained
63 /// in that package. The read() function is responsible for reading those same
64 /// sensors and moving the results into the standard structures contained within
65 /// the SensorFusionGlobals object.
66 ///@{
75 
84 
93 
94 ///@}
95 
96 
97 #endif // DRIVERS_H
int8_t MAG3110_Init(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXLS8952_Read(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t MPL3115_Idle(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXOS8700_Read(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t MMA8451_Read(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
void ARM_systick_enable(void)
The top level fusion structure.
int32_t ARM_systick_elapsed_ticks(int32_t start_ticks)
int8_t FXLS8471Q_Init(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t MAG3110_Read(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t MPL3115_Init(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXLS8471Q_Read(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
void ARM_systick_delay_ms(uint32_t iSystemCoreClock, uint32_t delay_ms)
int8_t FXLS8471Q_Idle(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t MMA8451_Idle(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXAS21002_Read(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t MPL3115_Read(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXLS8952_Idle(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t MMA8652_Read(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXOS8700_Init(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t MAG3110_Idle(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t MMA8652_Init(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXLS8952_Init(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXAS21002_Idle(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
An instance of PhysicalSensor structure type should be allocated for each physical sensors (combo dev...
int8_t MMA8451_Init(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t FXOS8700_Idle(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
int8_t MMA8652_Idle(PhysicalSensor *sensor, SensorFusionGlobals *sfg)
void ARM_systick_start_ticks(int32_t *pstart)
SensorFusionGlobals sfg
This is the primary sensor fusion data structure.
int8_t FXAS21002_Init(PhysicalSensor *sensor, SensorFusionGlobals *sfg)